<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * CargaLectiva filter form base class.
 *
 * @package    filters
 * @subpackage CargaLectiva *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseCargaLectivaFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'docente_curso_id'    => new sfWidgetFormDoctrineChoice(array('model' => 'DocenteCurso', 'add_empty' => true)),
      'aula_id'             => new sfWidgetFormDoctrineChoice(array('model' => 'Aula', 'add_empty' => true)),
      'hora_ingreso'        => new sfWidgetFormFilterInput(),
      'hora_salida'         => new sfWidgetFormFilterInput(),
      'dia_semana'          => new sfWidgetFormChoice(array('choices' => array('' => '', 'Monday' => 'Monday', 'Sunday' => 'Sunday', 'Tuesday' => 'Tuesday', 'Wednesday' => 'Wednesday', 'Thursday' => 'Thursday', 'Friday' => 'Friday', 'Saturday' => 'Saturday'))),
      'tema'                => new sfWidgetFormFilterInput(),
      'capitulo'            => new sfWidgetFormFilterInput(),
      'observaciones'       => new sfWidgetFormFilterInput(),
      'estado'              => new sfWidgetFormFilterInput(),
      'fecha_creacion'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'fecha_actualizacion' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
    ));

    $this->setValidators(array(
      'docente_curso_id'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'DocenteCurso', 'column' => 'id')),
      'aula_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Aula', 'column' => 'id')),
      'hora_ingreso'        => new sfValidatorPass(array('required' => false)),
      'hora_salida'         => new sfValidatorPass(array('required' => false)),
      'dia_semana'          => new sfValidatorChoice(array('required' => false, 'choices' => array('Monday' => 'Monday', 'Sunday' => 'Sunday', 'Tuesday' => 'Tuesday', 'Wednesday' => 'Wednesday', 'Thursday' => 'Thursday', 'Friday' => 'Friday', 'Saturday' => 'Saturday'))),
      'tema'                => new sfValidatorPass(array('required' => false)),
      'capitulo'            => new sfValidatorPass(array('required' => false)),
      'observaciones'       => new sfValidatorPass(array('required' => false)),
      'estado'              => new sfValidatorPass(array('required' => false)),
      'fecha_creacion'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'fecha_actualizacion' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('carga_lectiva_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'CargaLectiva';
  }

  public function getFields()
  {
    return array(
      'id'                  => 'Number',
      'docente_curso_id'    => 'ForeignKey',
      'aula_id'             => 'ForeignKey',
      'hora_ingreso'        => 'Text',
      'hora_salida'         => 'Text',
      'dia_semana'          => 'Enum',
      'tema'                => 'Text',
      'capitulo'            => 'Text',
      'observaciones'       => 'Text',
      'estado'              => 'Text',
      'fecha_creacion'      => 'Date',
      'fecha_actualizacion' => 'Date',
    );
  }
}